package uy.com.tsi2G7.superbet.bet;

import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Table(name="BETS")
@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(
    name="SUBCLASS",
    discriminatorType=DiscriminatorType.STRING
)
@DiscriminatorValue("ABSTRACT")
public class Bet {
	
	@Id 
	@GenericGenerator(name = "generator", strategy = "increment")
    @GeneratedValue(generator = "generator")
    @Column(name="BET_ID")
	private long id;
	@Column(name="DATE")
	private Date date;
	@Column(name="AMOUNT")
	private BigDecimal amount;
	@Column(name="USER",length=50)
	private String userId;
	@Enumerated(EnumType.STRING)
	@Column(name="STATE")
	private BetState state=BetState.OPEN;
	
	public BetState getState() {
		return state;
	}
	public void setState(BetState state) {
		this.state = state;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public BigDecimal getAmount() {
		return amount;
	}
	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}

}
